package com.nineclock.listener;

import com.nineclock.message.pojo.NcMessage;
import com.nineclock.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = "changeMongoPushTopic",consumerGroup = "changeMongoPushConsumer")
public class ChangeMongoListener implements RocketMQListener<String> {
    @Autowired
    MessageService messageService;
    @Override
    public void onMessage(String messageId) {
        messageService.updateMessageWithApproved(messageId);
    }
}
